#define _CRT_SECURE_NO_WARNINGS	

#include<stdio.h>

int main()
{
    int a, b;
    scanf("%d%d", &a, &b);
    int sum = a + b;
    a = (a > b) ? b : a;
    b = sum - a;
    int found = 0;
    for (int i = a; i <= b; i++)
    {
        if (i % 3 == 0 || i % 7 == 0)
        {
            found = 1;
            printf("%d ", i);
        }
    }
    if (!found)
        printf("None\n");
    return 0;
}